﻿<%@ Page Language="C#" MasterPageFile="../main.master" Inherits="VioletDevelopmentLaboratory.Net.Web.Configuration.VWebConfigManagerPage" %>

<script runat="server">
	protected void MembershipDetailsView_ItemUpdated(object sender, DetailsViewUpdatedEventArgs e)
	{
		ShowAlert_DetailsView_ItemUpdated(e);
	}

	
	
	
	
	
	
	
	
	
	protected void ProvidersGridView_SelectedIndexChanging(object sender, GridViewSelectEventArgs e)
	{
		ProvidersDetailsView.ChangeMode(DetailsViewMode.ReadOnly);
	}

	protected void ProvidersDetailsView_ItemInserted(object sender, DetailsViewInsertedEventArgs e)
	{
		ShowAlert_DetailsView_ItemInserted(e);

		ProvidersGridView.SelectedIndex = -1;
		ProvidersGridView.DataBind();
	}

	protected void ProvidersDetailsView_ItemUpdated(object sender, DetailsViewUpdatedEventArgs e)
	{
		ShowAlert_DetailsView_ItemUpdated(e);

		ProvidersGridView.SelectedIndex = -1;
		ProvidersGridView.DataBind();
	}

	protected void ProvidersDetailsView_ItemDeleted(object sender, DetailsViewDeletedEventArgs e)
	{
		ShowAlert_DetailsView_ItemDeleted(e);

		ProvidersDetailsView.ChangeMode(DetailsViewMode.Insert);

		ProvidersGridView.SelectedIndex = -1;
		ProvidersGridView.DataBind();
	}
</script>

<asp:Content ID="Content1" ContentPlaceHolderID="BodyContentPlaceHolder" runat="server">

	<h2>Membership (SqlMembershipProvider)</h2>

	<div>
		<asp:ObjectDataSource ID="MembershipDetailsViewDataSource" runat="server" 
			SelectMethod="GetMembership" 
			TypeName="VioletDevelopmentLaboratory.Net.Web.Configuration.MembershipSectionManager" 
			UpdateMethod="Modify">
			<UpdateParameters>
				<asp:Parameter Name="defaultProvider" Type="String" />
				<asp:Parameter Name="userIsOnlineTimeWindow" DbType="Time" />
				<asp:Parameter Name="hashAlgorithmType" Type="String" />
			</UpdateParameters>
		</asp:ObjectDataSource>
		<fieldset>
			<legend>membership</legend>
			<asp:DetailsView ID="MembershipDetailsView" runat="server" AutoGenerateRows="False" 
							DataSourceID="MembershipDetailsViewDataSource" DefaultMode="Edit" 
							onitemupdated="MembershipDetailsView_ItemUpdated" CellPadding="5">
				<Fields>
					<asp:BoundField DataField="DefaultProvider" HeaderText="DefaultProvider" 
						SortExpression="DefaultProvider" />
					<asp:BoundField DataField="HashAlgorithmType" HeaderText="HashAlgorithmType" 
						SortExpression="HashAlgorithmType" />
					<asp:BoundField DataField="UserIsOnlineTimeWindow" 
						HeaderText="UserIsOnlineTimeWindow" SortExpression="UserIsOnlineTimeWindow" />
					<asp:CommandField ButtonType="Button" ShowCancelButton="False" 
						ShowEditButton="True" />
				</Fields>
			</asp:DetailsView>
		</fieldset>
	</div>

	<div style="margin-left : 30px">
		<asp:ObjectDataSource ID="ProvidersDetailsViewDataSource" runat="server" 
			DeleteMethod="RemoveProvider" InsertMethod="AddProvider" 
			SelectMethod="GetProvider" 
			TypeName="VioletDevelopmentLaboratory.Net.Web.Configuration.MembershipSectionManagerForSql" 
			UpdateMethod="ModifyProvider" 
			
			
			
			DataObjectTypeName="VioletDevelopmentLaboratory.Net.Web.Configuration.SqlMembershipProviderSettings">
			<SelectParameters>
				<asp:ControlParameter ControlID="ProvidersGridView" Name="name" 
					PropertyName="SelectedValue" Type="String" />
			</SelectParameters>
		</asp:ObjectDataSource>
		<asp:ObjectDataSource ID="ProvidersGridViewDataSource" runat="server" 
			SelectMethod="GetProviders" 
			
			
			TypeName="VioletDevelopmentLaboratory.Net.Web.Configuration.MembershipSectionManagerForSql"></asp:ObjectDataSource>
		<fieldset>
			<legend>providers</legend>
			<asp:DetailsView ID="ProvidersDetailsView" runat="server" 
				AutoGenerateRows="False" DataSourceID="ProvidersDetailsViewDataSource" CellPadding="5" DefaultMode="Insert" 
				oniteminserted="ProvidersDetailsView_ItemInserted" 
				onitemupdated="ProvidersDetailsView_ItemUpdated" 
				onitemdeleted="ProvidersDetailsView_ItemDeleted" DataKeyNames="Name">
				<Fields>
					<asp:BoundField DataField="Name" HeaderText="Name" 
						SortExpression="Name" />
					<asp:BoundField DataField="Type" HeaderText="Type" SortExpression="Type" />
					<asp:BoundField DataField="ConnectionStringName" 
						HeaderText="ConnectionStringName" SortExpression="ConnectionStringName" />
					<asp:BoundField DataField="ApplicationName" HeaderText="ApplicationName" 
						SortExpression="ApplicationName" />
					<asp:BoundField DataField="CommandTimeout" HeaderText="CommandTimeout (30)" 
						SortExpression="CommandTimeout" />
					
					<asp:BoundField DataField="Description" HeaderText="Description" 
						SortExpression="Description" />
					<asp:CheckBoxField DataField="EnablePasswordRetrieval" 
						HeaderText="EnablePasswordRetrieval (false)" SortExpression="EnablePasswordRetrieval" />
					<asp:CheckBoxField DataField="EnablePasswordReset" 
						HeaderText="EnablePasswordReset (true)" SortExpression="EnablePasswordReset" />
					<asp:CheckBoxField DataField="RequiresQuestionAndAnswer" 
						HeaderText="RequiresQuestionAndAnswer (true)" 
						SortExpression="RequiresQuestionAndAnswer" />
					<asp:CheckBoxField DataField="RequiresUniqueEmail" 
						HeaderText="RequiresUniqueEmail (true)" SortExpression="RequiresUniqueEmail" />
					<asp:BoundField DataField="MaxInvalidPasswordAttempts" 
						HeaderText="MaxInvalidPasswordAttempts (5)" 
						SortExpression="MaxInvalidPasswordAttempts" />
					<asp:BoundField DataField="PasswordAttemptWindow" 
						HeaderText="PasswordAttemptWindow (10)" SortExpression="PasswordAttemptWindow" />
					<asp:BoundField DataField="MinRequiredPasswordLength" 
						HeaderText="MinRequiredPasswordLength (1)" 
						SortExpression="MinRequiredPasswordLength" />
					<asp:BoundField DataField="MinRequiredNonalphanumericCharacters" 
						HeaderText="MinRequiredNonalphanumericCharacters (1)" 
						SortExpression="MinRequiredNonalphanumericCharacters" />
					<asp:BoundField DataField="PasswordStrengthRegularExpression" 
						HeaderText="PasswordStrengthRegularExpression" 
						SortExpression="PasswordStrengthRegularExpression" />
					<asp:CommandField ButtonType="Button" ShowDeleteButton="True" 
						ShowEditButton="True" ShowInsertButton="True" />
				</Fields>
			</asp:DetailsView>
			<asp:GridView ID="ProvidersGridView" runat="server" AutoGenerateColumns="False" 
				CellPadding="5" DataSourceID="ProvidersGridViewDataSource" 
				onselectedindexchanging="ProvidersGridView_SelectedIndexChanging" DataKeyNames="Name">
				<Columns>
					<asp:CommandField ShowSelectButton="True" />
					<asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name" />
					<asp:BoundField DataField="Type" HeaderText="Type" SortExpression="Type" />
					<asp:BoundField DataField="ConnectionStringName" 
						HeaderText="ConnectionStringName" SortExpression="ConnectionStringName" />
					<asp:BoundField DataField="ApplicationName" HeaderText="ApplicationName" 
						SortExpression="ApplicationName" />
					<asp:BoundField DataField="CommandTimeout" HeaderText="CommandTimeout" 
						SortExpression="CommandTimeout" />
					<asp:BoundField DataField="Description" HeaderText="Description" 
						SortExpression="Description" />
					<asp:CheckBoxField DataField="EnablePasswordRetrieval" 
						HeaderText="EnablePasswordRetrieval" SortExpression="EnablePasswordRetrieval" />
					<asp:CheckBoxField DataField="EnablePasswordReset" 
						HeaderText="EnablePasswordReset" SortExpression="EnablePasswordReset" />
					<asp:CheckBoxField DataField="RequiresQuestionAndAnswer" 
						HeaderText="RequiresQuestionAndAnswer" 
						SortExpression="RequiresQuestionAndAnswer" />
					<asp:CheckBoxField DataField="RequiresUniqueEmail" 
						HeaderText="RequiresUniqueEmail" SortExpression="RequiresUniqueEmail" />
					<asp:BoundField DataField="MaxInvalidPasswordAttempts" 
						HeaderText="MaxInvalidPasswordAttempts" 
						SortExpression="MaxInvalidPasswordAttempts" />
					<asp:BoundField DataField="PasswordAttemptWindow" 
						HeaderText="PasswordAttemptWindow" SortExpression="PasswordAttemptWindow" />
					<asp:BoundField DataField="MinRequiredPasswordLength" 
						HeaderText="MinRequiredPasswordLength" 
						SortExpression="MinRequiredPasswordLength" />
					<asp:BoundField DataField="MinRequiredNonalphanumericCharacters" 
						HeaderText="MinRequiredNonalphanumericCharacters" 
						SortExpression="MinRequiredNonalphanumericCharacters" />
					<asp:BoundField DataField="PasswordStrengthRegularExpression" 
						HeaderText="PasswordStrengthRegularExpression" 
						SortExpression="PasswordStrengthRegularExpression" />
				</Columns>
				<SelectedRowStyle BackColor="SkyBlue" />
			</asp:GridView>
		</fieldset>
	</div>
</asp:Content>